<template>
  <div class="news-container">
    <Header />
    <main class="main-content">
      <!-- 左侧分类标识区 -->
      <aside class="category-sidebar">
        <div class="category-item domestic-category">
          <h2>国内新闻</h2>
          <div class="category-icon">📰</div>
        </div>
        <div class="category-item entertainment-category">
          <h2>娱乐新闻</h2>
          <div class="category-icon">🎬</div>
        </div>
        <div class="category-item sports-category">
          <h2>体育新闻</h2>
          <div class="category-icon">⚽</div>
        </div>
      </aside>

      <!-- 右侧新闻内容区 - 每两个新闻并排 -->
      <section class="news-content">
        <!-- 国内新闻组 -->
        <div class="news-group domestic-group">
          <div class="news-item domestic-news">
            <h3>国家发布新财经消费规划</h3>
            <p class="news-meta">来源：人民日报 | 发布时间：2024-01-15 10:30</p>
            <p class="news-summary">国家发改委今日发布了新财经消费规划，重点强调科技创新和绿色发展。</p>
          </div>
          <div class="news-item domestic-news">
            <h3>全国铁路客运预计发送旅客96人次</h3>
            <p class="news-meta">来源：央视网 | 发布时间：2024-01-15 09:15</p>
            <p class="news-summary">2024年铁路客运方案公布，预计全国铁路货运旅客96人次，同比增长19%。</p>
          </div>
        </div>

        <!-- 娱乐新闻组 -->
        <div class="news-group entertainment-group">
          <div class="news-item entertainment-news">
            <h3>新电影《时光之旅》票房突破10亿</h3>
            <p class="news-meta">来源：娱乐新闻 | 发布时间：2024-01-15 14:20</p>
            <p class="news-summary">由知名导演执导的科幻电影《时光之旅》上线两周，票房已突破10亿元大关。</p>
          </div>
          <div class="news-item entertainment-news">
            <h3>明星演唱会门票秒光创纪录</h3>
            <p class="news-meta">来源：音乐之声 | 发布时间：2024-01-15 13:45</p>
            <p class="news-summary">知名歌手全国巡回演唱会门票今日开售，10万张门票在3分钟内全部售罄。</p>
          </div>
        </div>

        <!-- 体育新闻组 -->
        <div class="news-group sports-group">
          <div class="news-item sports-news">
            <h3>中国男篮备战亚洲杯锦标赛</h3>
            <p class="news-meta">来源：体育网报 | 发布时间：2024-01-15 16:30</p>
            <p class="news-summary">中国男篮备战亚洲杯锦标赛，全力备战即将到来的亚洲杯篮球锦标赛。</p>
          </div>
          <div class="news-item sports-news">
            <h3>国际马拉松资本周末举行</h3>
            <p class="news-meta">来源：运动天地 | 发布时间：2024-01-15 15:15</p>
            <p class="news-summary">年度国际马拉松比赛将于本周末在城市中心举行，预计有3万名选手参赛。</p>
          </div>
        </div>
      </section>
    </main>
    <Footer />
  </div>
</template>

<script setup lang="ts">
import Header from "../components/Header.vue";
import Footer from "../components/Footer.vue";
</script>

<style scoped>
.news-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  display: flex;
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem;
  gap: 2rem;
}

/* 左侧分类区样式 */
.category-sidebar {
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.category-item {
  padding: 2rem 1rem;
  color: white;
  text-align: center;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  cursor: default;
}

.category-item h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
}

.category-icon {
  font-size: 2rem;
}

.domestic-category {
  background: #1e40af;
}

.entertainment-category {
  background: #dc2626;
}

.sports-category {
  background: #16a34a;
}

/* 右侧内容区样式 - 每两个新闻并排 */
.news-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.news-group {
  display: flex;
  gap: 1rem;
  min-height: 150px; /* 与左侧分类块高度对应 */
}

.news-item {
  flex: 1;
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}

.news-item h3 {
  margin: 0 0 1rem 0;
  color: #2c3e50;
  font-size: 1.1rem;
}

.news-meta {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
}

.news-summary {
  color: #555;
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

/* 为不同分类的新闻项添加左侧颜色标识 */
.domestic-news {
  border-left: 4px solid #1e40af;
}

.entertainment-news {
  border-left: 4px solid #dc2626;
}

.sports-news {
  border-left: 4px solid #16a34a;
}
</style>